<template>
  <StationPortal 
    :stcd="stcd"
    :name="name"
    :type="type"
    :q="q"
  />
</template>

<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import StationPortal from '@/components/StationSearch/StationPortal.vue'

// 页面参数
const stcd = ref('')
const name = ref('')
const type = ref('')
const q = ref('')

onLoad((options) => {
  console.log('portal页面加载，参数:', options)
  
  if (options.stcd) {
    stcd.value = decodeURIComponent(options.stcd)
  }
  if (options.name) {
    name.value = decodeURIComponent(options.name)
  }
  if (options.type) {
    type.value = decodeURIComponent(options.type)
  }
  if (options.q) {
    q.value = decodeURIComponent(options.q)
  }
  
  // 设置页面标题
  if (name.value) {
    uni.setNavigationBarTitle({ title: name.value })
  }
})
</script>

<style>
page {
  height: 100%;
  background: #0f172a;
}
</style>

